// example routes, please remove them or update them as appropriate
get "/about", redirect: "/about.groovy",cache: 2.hours
get "/article/@title",forward: "/singleBlog.groovy?title=@title"

//翻页url重写
get "/editlist/@page",forward: "/showAllArticle.groovy?page=@page",validate: { page.isNumber() }
get "/commlist/@page",forward: "/showAllComment.groovy?page=@page",validate: { page.isNumber() }
get "/userlist/@page",forward: "/showAllUser.groovy?page=@page",validate: { page.isNumber() }
get "/page/@page",forward: "/showIndexBlogs.groovy?page=@page",validate: { page.isNumber() }

get "/editarticle/@link",forward: "/editArticle.groovy?link=@link"
get "/edituser/@name",forward: "/editUser.groovy?name=@name"
get "/deletearticle/@link",forward: "/deleteArticle.groovy?link=@link"
get "/deletecomment/@id",forward: "/deleteComment.groovy?id=@id"
get "/deleteuser/@name",forward: "/deleteUser.groovy?name=@name"

//反参数注入
post "/adduser",forward: "/addUser.groovy"
post "/updateuser",forward: "/saveUser.groovy"
post "/addarticle",forward: "/addArticle.groovy"
post "/updatearticle",forward: "/saveArticle.groovy"
post "/addcomment",forward: "/addComment.groovy"

//外部跳转
get "/goto/@url", redirect: "http://@url"
